package com.symone.webcms.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 *   @description : ModuleField 实体类
 *   ---------------------------------
 * 	 @author Archer Chu
 *   @since 2019-01-09
 */
@Data
@Accessors(chain = true)
@TableName("sys_module_field")
public class ModuleField extends Model<ModuleField> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Long id;
	@ApiModelProperty("模型")
	private String module;
	@ApiModelProperty("字段分组名")
	@TableField("tab_name")
	private String tabName;
	@ApiModelProperty("标题")
	private String title;
    /**
     * 字段名称
     */
	@ApiModelProperty("字段名称")
	private String name;
    /**
     * 提示
     */
	@ApiModelProperty("提示")
	private String tip;
    /**
     * 类型
     */
	@ApiModelProperty("类型")
	private String type;
	@ApiModelProperty("数值")
	private String dvalues;
	@ApiModelProperty("默认值")
	@TableField("default_value")
	private String defaultValue;
    /**
     * 是否是系统
     */
	@ApiModelProperty("是否是系统")
	@TableField("is_system")
	private Integer isSystem;
	/**
	 * 是否必填
	 */
	@ApiModelProperty("是否必填")
	private Integer required;
	/**
	 * 是否作为存查询条件
	 */
	@ApiModelProperty("是否查询条件")
	private Integer searched;
    /**
     * 是否列表显示
     */
	@ApiModelProperty("是否列表显示")
	private Integer listed;

	@TableField("list_width")
	private Integer listWidth;
    /**
     * 排序
     */
	@ApiModelProperty("排序")
	private Integer sorting;
	private Integer deleted;
	@TableField("create_user")
	private String createUser;
	@TableField("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	@TableField("update_user")
	private String updateUser;
	@TableField("update_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;


	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}
